﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace S.Common.Extensions
{
    public static class ServicCollectionExtensions
    {
        //必须为static
        /// <summary>
        /// 扩展方法解读
        /// </summary>
        /// <param name="value">扩展类型参数代表扩展类型</param>
        /// <returns></returns>
        public static int ToInt(this string value)//this 后面加需要扩展的类型
        {
            int number = 0;
            if (!int.TryParse(value, out number)) ;
            return number;
        }
    }
}